package com.ftg.learn.smhtml.mapper;



import com.ftg.learn.smhtml.pojo.Employee;
import org.apache.ibatis.annotations.*;

import java.util.List;


@Mapper
public interface EmployeeMapper {

    @SelectProvider(type=EmployeeSql.class,method="getCountSql")
    public List<Employee> getCount(String id);


    @SelectProvider(type=EmployeeSql.class,method="getShowAllSql")

    public List<Employee> showAll(String  id,int begin,int end);


    @Select("select * from employee where eno = #{id}")
    public List<Employee> findone(String id);

    @Update("update employee set ename=#{ename},eage=#{eage},esex=#{esex},epost=#{epost},eschool=#{eschool},epicture=#{epicture},eintroduce=#{eintroduce} where eno=#{eno}")
    public int update(Employee employee);

    @Delete("delete from employee where eno=#{id}")
    public int delete(String id);

    @Insert("insert into employee(eno,ename,eage,esex,epost,eschool,epicture,eintroduce) values(#{eno},#{ename},#{eage},#{esex},#{epost},#{eschool},#{epicture},#{eintroduce})")
    public int save(Employee employee);
}